//
//  MKTChatMsgTVCellTextMine.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2021/7/8.
//  Copyright © 2021 moon. All rights reserved.
//

#import "MKTChatMsgTextTVCellMine.h"

@implementation MKTChatMsgTextTVCellMine
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        //
        self.msgTextBubbleView = [[MKTChatTextBubbleViewMine alloc] init];
        [self.contentView addSubview:self.msgTextBubbleView];
        //
        self.flowlayout = [[MKUIFlowLayoutConstraint alloc] initWithItems:@[self.msgTextBubbleView,self.msgUserPicView] constraintParam:(MKUIFlowLayoutConstraintParam_H_T_R) contentInsets:UIEdgeInsetsMake(5, 55, 5, 20) interitemSpacing:5];
    }
    return self;
}
- (void)customLayoutSubviews{
    [super customLayoutSubviews];
    CGRect bounds = self.contentView.bounds;
    self.flowlayout.bounds = bounds;
    [self.flowlayout layoutItemsWithResizeItems:YES];
}
- (void)customReloadCellModel{
    [super customReloadCellModel];
    MKTChatMsgText *msg = self.chatMsg;
    self.msgTextBubbleView.textLabel.text = msg.text;
}
- (CGSize)customSizeThatFits:(CGSize)size{
    return [self.flowlayout sizeThatFits:size resizeItems:YES];
}
@end
